
module.exports = function (grunt) {

  // 项目配置
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    buildJs: [{
      src: ['app/common/js/global-init/global-init-dependencies.js',
        'app/common/js/global-init/global-init-core.js',
        'app/common/js/global-init/global-init-custom.js'],
      dest: 'app/common/js/global-init/global-init-all.js',
      minDest: 'app/common/js/global-init/global-init-all.min.js',
      destTemplate: 'build/templates/global-init-all.js.tmpl'
    },
    {
      src: ['app/common/js/global-utils/global-utils-dependencies.js',
        'app/common/js/global-utils/global-utils-core.js',
        'app/common/js/global-utils/global-utils-common.js',
        'app/common/js/global-utils/global-utils-object.js',
        'app/common/js/global-utils/global-utils-date.js',
        'app/common/js/global-utils/global-utils-html.js',
        'app/common/js/global-utils/global-utils-url.js',
        'app/common/js/global-utils/global-utils-form.js'],
      dest: 'app/common/js/global-utils/global-utils-all.js',
      minDest: 'app/common/js/global-utils/global-utils-all.min.js',
      destTemplate: 'build/templates/global-utils-all.js.tmpl'
    },
    {
      src: ['app/common/js/ui-utils/ui-utils-dependencies.js',
        'app/common/js/ui-utils/ui-utils-core.js',
        'app/common/js/ui-utils/ui-utils-common.js',
        'app/common/js/ui-utils/ui-utils-event.js',
        'app/common/js/ui-utils/ui-utils-form.js',
        'app/common/js/ui-utils/ui-utils-data-grid.js',
        'app/common/js/ui-utils/ui-utils-date-picker.js',
        'app/common/js/ui-utils/ui-utils-tree.js',
        'app/common/js/ui-utils/ui-utils-dialog.js',
        'app/common/js/ui-utils/ui-utils-view.js'],
      dest: 'app/common/js/ui-utils/ui-utils-all.js',
      minDest: 'app/common/js/ui-utils/ui-utils-all.min.js',
      destTemplate: 'build/templates/ui-utils-all.js.tmpl'
    }]
  });

  // 加载任务
  grunt.loadTasks('build/tasks');
  // 注册默认任务
  grunt.registerTask('default', ['buildJs']);
};
